import http from './index'


export function system() {
  return http.get('/system/pledge')
}

export function get(id) {
  return http.get('/member/base/pledge' + (id ? '/' + id : ''))
}

export function self() {
  return http.get('/member/base/pledge/self')
}

export function update(data) {
  return http.put('/member/base/pledge/' + data.id, data)
}

export function create() {
  return http.post('/auth/base/pledge')
}

export function post(data) {
  return http.post('/member/log/pledge', data)
}

export function log() {
  return http.get('/member/log/pledge')
}

export function ransom(id, action = 'ransom') {
  return http.put('/member/log/pledge/' + id, { action })
}